define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'spell.spell_list/index',
        add_url: 'spell.spell_list/add',
        edit_url: 'spell.spell_list/edit',
        delete_url: 'spell.spell_list/delete',
        export_url: 'spell.spell_list/export',
        modify_url: 'spell.spell_list/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID'},
                    {field: 'spellGroup.master_img', title: '头像'},
                    {field: 'spellGroup.master_name', title: '团长'},
                    {field: 'spellGroup.start_time', title: '开团时间'},
                    {field: 'spellGroup.start_time', title: '拼团商品'},
                    {field: 'spellGroup.spell_group_number', title: '几人团'},
                    {field: 'spellGroup.spell_group_number', title: '几人参加'},
                    {field: 'spellGroup.end_time', title: '结束时间'},
                    {field: 'spellGroup.status', title: '拼团状态', templet: ea.table.switch},

                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});